# MicroPython 示例代码
import time
from machine import Pin

# 设置板载 LED (通常在 Pin 2，根据您的设备调整)
led = Pin(2, Pin.OUT)

print("MicroPython LED 闪烁示例")
print("按 Ctrl+C 停止")

try:
    while True:
        led.on()
        print("LED 开启")
        time.sleep(1)

        led.off()
        print("LED 关闭")
        time.sleep(1)
except KeyboardInterrupt:
    print("程序已停止")
    led.off()
